package com.stlm2.dems.entity.base;

import com.stlm2.dems.entity.CommentsProperty;
import com.stlm2.dems.entity.Graded;

import java.util.Date;

/**
 * Created by zlq on 2017/10/17.
 */
public class BaseComments {
    //
    private int id;
    //用户ID
    private int userId;
    //评论内容
    private  String  content;
    //展示图片路径
    private String imgUrl;
    //订单ID
    private int orderId;
    //评论时间
    private Date  createTime;
    //是否有效
    private boolean isValid;
    //评论回复
    private String replyMessage;
    //商品ID
    private int goodsId;
    //评分
    private Graded graded;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public boolean getIsValid() {
        return isValid;
    }

    public void setIsValid(boolean valid) {
        isValid = valid;
    }

    public String getReplyMessage() {
        return replyMessage;
    }

    public void setReplyMessage(String replyMessage) {
        this.replyMessage = replyMessage;
    }

    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    public Graded getGraded() {
        return graded;
    }

    public void setGraded(Graded graded) {
        this.graded = graded;
    }

    public Integer getGradedValue(){
        return (graded != null) ? graded.getIntValue() : null;
    }

    public void setGradedValue(Integer v){
        if(v != null)
            graded = Graded.getByIntValue(v);
    }

}
